package com.netty.nettyserver;

import com.netty.nettyserver.listener.NettyServerListener;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class NettyServerApplication implements CommandLineRunner{

	public static void main(String[] args) {
		SpringApplication.run(NettyServerApplication.class, args);
	}

	@Override
	public void run(String... args) throws Exception {
		Thread.sleep(3000);
		System.out.println("==========RUNNING=========");
		NettyServerListener nettyServerListener = new NettyServerListener();
		new Thread(new Runnable() {
			@Override
			public void run() {
				nettyServerListener.start();
			}
		}).start();
		System.out.println("==========NETTY-SERVER-STARTED=========");
	}
}
